import {
	request
} from './unit.js';



const login = () => {
	request({
		url: 'login',
		header: {
			Authorization: `Bearer ${window.TOKEN}`
		}
	}).then(res => {
		
	})
}

const order_list = (status) => {
	return request({
		url: 'order_list',
		header: {
			Authorization: `Bearer ${window.TOKEN}`
		},
		data: {
			status
		}
	}).then(res => {
		return res.data.data.data;
	})
}

const order_info = (id) => {
	return request({
		url: 'order_info',
		header: {
			Authorization: `Bearer ${window.TOKEN}`
		},
		data: {
			id
		}
	}).then(res => {
		return res.data.data;
	})
}

const end_trip = (id) => {
	return request({
		url: 'end_trip',
		header: {
			Authorization: `Bearer ${window.TOKEN}`
		},
		data: {
			id
		}
	}).then(res => {
		return res.data;
	})
}
export {
	login,
	order_list,
	order_info,
	end_trip
}
